/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function $(par, par1) {
    if (par.substr(0, 1) == "#") {
        var id = par.substr(1, par.length - 1);
        return document.getElementById(id);
    }

    if (par.substr(0, 1) == ".") {
        var _class = par.substr(1, par.length - 1);
        return getElementByClass(par1, par2);
    }

    return null;
}

function getElementByClass(className, node) {
    var array = new Array();

    // Check node
    if (node == null) {
        node = document;
    }

    //Create Array of All HTML Tags
    var tags=node.getElementsByTagName("*");

    //Loop through all tags using a for loop
    for (i=0; i<tags.length; i++) {
        //Get all tags with the specified class name.
        if (tags[i].className == className) {
            array.push(tags[i]);
        }
    }

    return array;
}
